﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace api2.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
   
    public class IdentityController : ControllerBase
    {
        [Authorize]
        [HttpGet]
        public IActionResult Get()
        {
            return new JsonResult(new { Name="api2"});
        }
        [Authorize(Policy ="Permission")]
        [HttpGet]
        public IActionResult GetPermission()
        {
            return new JsonResult(new { Name="api2",Role="policy"});
        }
    }
}